﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="associateProject.aspx.cs" Inherits="Docsbox.Layouts.Docsbox.associateProject" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<style type="text/css">
    .field-label {
        margin: 5px 10px 5px 0px;
        font-size: 12px;
        line-height: 20px;
        width: 120px;
        text-align: right;
    }
    .field-data {
        padding-left: 5px;
    }
    .docsbox-ddl {
        width: 250px;
        margin: 5px 5px 5px 0px;
    }
    .search-input-box {
            display: block;
            float: left;
            width: 250px;
            margin: 5px 5px 5px 0px;
    }
    .submit-control {
        margin: auto;
        padding: 5px 0px 5px 0px;
        padding-left: 140px;
    }
    .alert {
        padding: 8px 35px 8px 14px;
        margin-bottom: 20px;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
        border: 1px solid #FBEED5;
        border-radius: 4px;
    }
    .alert-error {
        color: #B94A48;
        border-color: #EED3D7;
        background-color: #F2DEDE;
    }
</style>

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    
    <div class="alert alert-error" runat="server" Visible="False" id="lblOverwriteMessage">
        <strong>Error:</strong> A file with the same name is already associated to this account.
    </div>

    <script type="text/javascript">
    </script>
    <fieldset>
        <legend>Search Account</legend>
        <table style="padding: 10px;">
            <tr>
                <td class="field-label">Branch</td>
                <td class="field-data">
                    <asp:DropDownList ID="ddlOffices" CssClass="docsbox-ddl" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="field-label">Account Status</td>
                <td class="field-data">
                    <asp:DropDownList ID="ddlStatus" CssClass="docsbox-ddl" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="field-label">Keyword</td>
                <td class="field-data">
                    <asp:TextBox ID="txtKeyword" CssClass="search-input-box" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="submit-control" colspan="2">
                    <asp:Button ID="btnSearch" OnClick="btnSearch_Cilck" OnClientClick="_spFormOnSubmitCalled=false;" runat="server" Text="Search" />
                </td>
            </tr>
        </table>
    </fieldset>
    
    <div>
        <fieldset id="searchReulstBox">
            <legend>Search Result</legend>
            <div style="padding: 10px;">
            <asp:GridView runat="server" ID="listGV" AllowSorting="True" 
                DataKeyNames="ItemId" AutoGenerateColumns="False" CellPadding="4" 
                AllowPaging="False"
                ForeColor="#333333" GridLines="None" EnableModelValidation="True" >
                <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="checkBoxSelected" AutoPostBack="True" OnCheckedChanged="checkBoxSelected_Changed"/>
                    </ItemTemplate>
                    <ItemStyle Width="30px" HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField Visible="False">
                    <ItemTemplate>
                        <asp:Label runat="server" Visible="False" ID="lblItemId" Text='<%# Eval("ItemId") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Deal No.">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblDealNo" Text='<%# Eval("MTFNumber") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="80px" HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:BoundField DataField="FirstName" HeaderText="FirstName">
                <ItemStyle Width="100px" HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Surname" HeaderText="Surname">
                <ItemStyle Width="100px" HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="RegistrationNumber" HeaderText="Reg No.">
                <ItemStyle Width="100px" HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Office" HeaderText="Branch">
                <ItemStyle Width="100px" HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Status" HeaderText="Status">
                <ItemStyle Width="240px" HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>            
                <EditRowStyle BackColor="#2461BF" />
                <EmptyDataTemplate>
                    No Record. Refine your search Cretiria.
                </EmptyDataTemplate>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
            </div>
        <input id="selectedProject" type="hidden" runat="server"/>
        </fieldset>
        <div style="padding: 10px 20px 10px 20px; color:red;">
            <asp:Literal runat="server" ID="Message"></asp:Literal>
        </div>
    </div>
    <div style="padding:10px;">
        <table>
            <tr><td style="width: 120px;">
                    <asp:Button runat="server" ID="btnCancel" Text="Cancel" OnClientClick="javascript:window.frameElement.commitPopup();" />
                </td>
                <td style="width: 120px;">
                    <asp:Button runat="server" ID="btnSelect"  OnClick="btnSelect_Click" Text="Select"/>
                </td>
                <td style="width: 150px;">
                     <asp:Panel runat="server" ID="panelReadyforAudit" Visible="False">
                        <asp:CheckBox runat="server" ID="checkBoxReadyforAudit" Text="Ready for Audit" />
                    </asp:Panel>
                </td></tr>
        </table>
    </div>
<h1>
    <asp:Label ID="lblDocumentName" runat="server" ></asp:Label>

</h1>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Associate Document to Account
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>
